<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Backlink extends CI_Controller {
	public function index() {
            if($this->session->userdata('isLoggedIn')) {
                
                $this->load->view('crm/portal',$data);                 
            }
            else {
                redirect('login');
            }
           
	}
        
        public function showAddBacklinkForm(){
            echo json_encode($data);
        }
        
        public function  hideAddBacklinkForm(){
            echo json_encode($data);
        }

        public function addBacklink(){
            $backlinkPartner = $this->input->post('backlinkPartner');
            $backlinkLink = $this->input->post('backlinkLink');
            $backlinkDesc = $this->input->post('backlinkDesc');
            
            if(!$backlinkPartner || !$backlinkLink || $backlinkDesc){
                 $data['error'] = 'Please fill in all required fields.';
                echo json_encode($data);
            }
            else{
                echo json_encode($data);
            }
        }
        
}